<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Properties</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('kvlclib_properties.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Properties </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="kvlclib_section_checking_property_defaults"></a>
Checking property defaults</h1>
<p>As could be seen in <a class="el" href="kvlclib_converting.html">Converting</a>, we were able to overwrite files by enabling the property <a class="el" href="kvlclib_8h.html#a367688bca5aa3d831365e58de09ed47a">KVLC_PROPERTY_OVERWRITE</a>.</p>
<p>To verifiy that <a class="el" href="kvlclib_8h.html#a367688bca5aa3d831365e58de09ed47a">KVLC_PROPERTY_OVERWRITE</a> is in fact off by default we can do the following:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> defaultval;</div><div class="line"></div><div class="line">stat = <a class="code" href="group__kvlc__converter.html#gaa674bba6c26b0146d416051b4d048d7c">kvlcGetWriterPropertyDefault</a>(<a class="code" href="kvlclib_8h.html#a6a2c08efd64bfc6d91cb219189d17d5b">KVLC_FILE_FORMAT_KME50</a>, <a class="code" href="kvlclib_8h.html#a367688bca5aa3d831365e58de09ed47a">KVLC_PROPERTY_OVERWRITE</a>, &amp;defaultval, <span class="keyword">sizeof</span>(defaultval));</div><div class="line">...</div><div class="line"></div><div class="line">printf(<span class="stringliteral">&quot;Overwrite on CSV, def. value: %d\n&quot;</span>, defaultval);</div></div><!-- fragment --><p>We get the output: </p><div class="fragment"><div class="line">Overwrite on CSV, def. value: 0</div></div><!-- fragment --><h1><a class="anchor" id="kvlclib_section_setting_properties"></a>
Setting properties</h1>
<p>We begin by instantiating the converter and specifying the output file + format specifier:</p>
<div class="fragment"><div class="line"><a class="code" href="kvlclib_8h.html#a0b9cf61f2cc7afc5765a9432153e6fa8">KvlcStatus</a> stat;</div><div class="line"><a class="code" href="kvlclib_8h.html#a7cd7d86b7a164190a08a811db633b38d">KvlcHandle</a> hnd;</div><div class="line"><span class="keywordtype">int</span> propval;</div><div class="line"></div><div class="line">stat = <a class="code" href="group__kvlc__converter.html#ga2ae30246197c77907624f2b1457a104f">kvlcCreateConverter</a>(&amp;hnd, <span class="stringliteral">&quot;outputfile.kme50&quot;</span>, <a class="code" href="kvlclib_8h.html#a6a2c08efd64bfc6d91cb219189d17d5b">KVLC_FILE_FORMAT_KME50</a>);</div></div><!-- fragment --><p>We can now configure the converter for automatic overwrites. </p><div class="fragment"><div class="line">propval = 1;</div><div class="line">stat = <a class="code" href="group__kvlc__converter.html#ga5c66494a5c025af27b0eace33e02dbf9">kvlcSetProperty</a>(hnd, <a class="code" href="kvlclib_8h.html#a367688bca5aa3d831365e58de09ed47a">KVLC_PROPERTY_OVERWRITE</a>, &amp;propval, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div></div><!-- fragment --><h1><a class="anchor" id="kvlclib_section_checking_properties"></a>
Checking properties</h1>
<p>The property <a class="el" href="kvlclib_8h.html#a367688bca5aa3d831365e58de09ed47a">KVLC_PROPERTY_OVERWRITE</a> is available for all converters. Some however, aren't.</p>
<p>To check if a property is supported, we call the function <a class="el" href="group__kvlc__output.html#ga2f671daa7746e63fb8697f914904f19e">kvlcIsPropertySupported</a>.</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> supported;</div><div class="line"></div><div class="line">stat = <a class="code" href="group__kvlc__output.html#ga2f671daa7746e63fb8697f914904f19e">kvlcIsPropertySupported</a>(<a class="code" href="kvlclib_8h.html#a6a2c08efd64bfc6d91cb219189d17d5b">KVLC_FILE_FORMAT_KME50</a>, <a class="code" href="kvlclib_8h.html#aae5ccde884e49f6bcf3bb3f3621c17f4">KVLC_PROPERTY_CALENDAR_TIME_STAMPS</a>, &amp;supported);</div><div class="line"></div><div class="line">...</div><div class="line"></div><div class="line">printf(<span class="stringliteral">&quot;Supported: %d\n&quot;</span>, supported); <span class="comment">// Supported: 0</span></div></div><!-- fragment --><p>We find that the property is not supported for <a class="el" href="kvlclib_8h.html#a6a2c08efd64bfc6d91cb219189d17d5b">KVLC_FILE_FORMAT_KME50</a>. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="page_kvlclib.html">Converter API (kvlclib)</a></li>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
